<%@page import="com.team.util.DateCount"%>
<%@page import="com.team.util.ObjectUtil"%>
<%@page import="com.team.entity.Record"%>
<%@page import="com.team.entity.Project"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.team.entity.Contact"  %>
<%@ page import="com.team.util.Const"  %>
<%@ page import="com.team.entity.User" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title>联系人</title>
	<link rel="stylesheet" href="css/prettify.css" />
    <link rel="stylesheet" href="css/bootstrap.min.css" />
    <script type="text/javascript" src="js/jquery.js"></script>
</head>
<body class="body">

<% 
	User user = (User)session.getAttribute(Const.SESSION_USER); 
	Project project =(Project)session.getAttribute(Const.SESSION_PROJ);
 %>
 
	<div class="navbar navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<a href="#" class="brand">凯盛项目管理系统</a>
				 <ul class="nav pull-right">
						<li><a class="nav pull-right" href="#">用户名：<%=user.getUsername() %></a></li>
				 </ul>
			</div>
		</div>
	</div>
	
	<div class="container">
		<div class="row">
				<div class="span3">
						<div class="well" style="padding: 8px 0;">
							<ul class="nav nav-list">
							  <li class="nav-header"><%=project.getProjName() %></li>
							  <li class="divider"></li>
							  <li ><a href="info.jspx?_m=select&projId=<%=project.getId() %>"><i class=" icon-home"></i>最新动态</a></li>
							  <li><a href="addGoal.jspx?_m=select"><i class="icon-flag"></i>目标</a></li>
							  <li><a href="docShare.jspx?_m=select&projId=<%=project.getId() %>"><i class="icon-folder-open"></i>资料库</a></li>
							  <li><a href="newFolder.jspx?_m=select"><i class="icon-file"></i>文件共享</a></li>
							  <li  class="active"><a href="newContact.jspx?_m=select&projId=<%=project.getId() %>"><i class="icon-white icon-user"></i>联系人</a></li>
							  <li><a href="newIdea.jspx?_m=select&id=<%=project.getId() %>"><i class="icon-fire"></i>想法</a></li>
							  <li><a href="findBug.jsp"><i class="icon-warning-sign"></i>Bug</a></li>
							  <li><a href="projReset.jsp"><i class="icon-cog"></i>项目设置</a></li>
							</ul>
						</div>
				</div>
									
								
			<div class="span9">
			 
		  <c:choose>
			<c:when test="${param.code=='1001'}">
				<div style="color:red;">记录内容不可以为空</div>
			</c:when>
		</c:choose>
			
			<ul style="margin-bottom:0px;border-radius: 3px 3px 0 0" class="breadcrumb">
				<li class="active">
					<a href="task.html"><i class="icon-user"></i>联系人</a>
				</li>
			</ul>
			<div class="wall">
				<%
						Contact ct = (Contact)session.getAttribute(Const.SESSION_CONTACT_RECORED);
						if(ct == null ){
						 %>
						 <div style="color:red;">没有记录</div>
						 <%}else { %>
						 <%=ct.getId() %>
						<address>
							<h3>姓名：<%=ct.getContactName() %></h3>
							<p>公司：</p>
							<small>手机：<%=ct.getMobelNum() %></small><br/>
							<small>固话：<%=ct.getTelNum() %></small><br/>
							<small>邮箱：<%=ct.getEmail() %></small><br/>
							<small>地址：<%=ct.getAddress() %></small><br/>
							<small>主页：</small> <a href="<%=ct.getWebSate() %>"><%=ct.getWebSate() %></a><br/>
							<small>微博：</small> <a href="<%=ct.getWeiBo() %>"><%=ct.getWeiBo() %></a><br/>
						</address>
						
						
						
						<div class="line"><h3>记录</h3></div>
						<form action="record.jspx?_m=save&conId=<%=ct.getId() %>" method="post" >
							<textarea rows="3" name = "content" class="span5"></textarea>
							<br/>
							<button>发布</button>
						</form>
						
						<%
							List<Record> list = (List<Record>)session.getAttribute(Const.SESSION_RECORDS);
							Map<Record,User> map = (Map<Record,User>)session.getAttribute(Const.SESSION_RECORMAP);
							if(list != null && map != null){
							for(Record record : list){
						 %>
						<blockquote>
						<%=record.getContent() %>
						  <small><%=map.get(record).getUsername() %>发布于 前</small>
						</blockquote>
						
						<%}} }%>
						<a href="contact.jsp">←返回联系人列表</a>
						
			</div>
			
			
			
		</div>
			</div>
		
	</div>
	
</body>
</html>